%%% Copyright 2010 Google Inc.
%%%
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%%     http://www.apache.org/licenses/LICENSE-2.0
%%%
%%% Unless required by applicable law or agreed to in writing, software
%%% distributed under the License is distributed on an "AS IS" BASIS,
%%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%%% See the License for the specific language governing permissions and
%%% limitations under the License.

%%% Author <jacoby@google.com> Jacoby Thwaites [http://sites/madcloud]
%%%
%%% Header file for client modules.

%% Client defines are prefixed with TXM_
-define(TXM_UNDEFINED, undefined).
-define(TXM_ANY_COOKIE, '$any_cookie').

%% Prog version can be specified by label, number, latest or dynamic.
%% Dynamic attachments are always re-attached to the latest version
%% as this gets updated.
-type(txm_version_spec() :: string() | integer() | none | latest | dynamic).

%% An attach spec is passed to the view_fsm:attach/2 function.
-define(TXM_ATTACH_SPEC, txm_attach_spec).
-record(?TXM_ATTACH_SPEC, {
        prog = ?TXM_UNDEFINED    :: string(),
        version = none           :: txm_version_spec(),
        folder = ""              :: string(),
        cookie = ?TXM_ANY_COOKIE :: term()}).
-type(txm_attach_spec() :: #?TXM_ATTACH_SPEC{}).
